import { useTable, LIST_TYPE } from '@crud/index';
import { getAccountList } from '@/api/crm-kgj/auth';

export const useTableList = (options: any = {}) => {
  const columns = [
    { type: 'index' },
    { type: 'selection' },
    { label: '用户名称', prop: 'name', minWidth: '360px', align: 'left' },
    { label: '用户角色', prop: 'role_name', minWidth: '120px' },
    { label: '操作', prop: 'actions', minWidth: '120px', render: 'actions' }
  ];

  return useTable({
    ...options,
    type: LIST_TYPE.KGJ,
    columns: columns,
    getList: (params: any) => getAccountList(params)
  });
};
